def how_many_words(s):
    return len(s.split())


def letter_cnt(s):  # using dict
    letter_appear_times = {'a': 0}
    for ch in s:
        if not ch.isalpha(): continue
        c = ch.lower()
        if c in letter_appear_times.keys():
            letter_appear_times[c] += 1
        else:
            letter_appear_times[c] = 1
    return letter_appear_times


def appeared_letters(s):  # using set
    letters = set()
    for ch in s:
        if ch.isalpha(): letters.add(ch.lower())
    return letters


test_str = "The quick brown fox jumps over a lazy dog. "

print(how_many_words(test_str))
print(letter_cnt(test_str))
print(sorted(list(appeared_letters(test_str))))
